import ProxyInterface from '../proxy-interface';
import {CommentModel} from '@pkpm/pkpm-types';

class CommentProxy implements ProxyInterface<CommentModel> {
    private comment = new CommentModel();

    constructor(responseData) {
        let data = responseData.data || responseData;
        Object.assign<CommentModel, any>(this.comment, data);
    }

    getModel(): CommentModel {
        return this.comment;
    }
}

class CommentArrayProxy implements ProxyInterface<CommentModel[]> {
    private comment = [];

    constructor(responseData) {
        let data = responseData.data || responseData;
        this.comment = data;
    }

    getModel(): CommentModel[] {
        return this.comment;
    }
}

export {CommentProxy, CommentArrayProxy};
